# -*- coding: utf-8 *-*
from structures.hashtable import HashTable


class Actor():

    def __init__(self, name):
        self.name = name
        self.__titlesHash = HashTable()
        self.titles = []

    def add_title(self, title):
        if self.__titlesHash[title] is None:
            self.__titlesHash[title] = True
            self.titles.append(title)

    def to_string(self):
        output = self.name + ':'
        for title in self.titles:
            output += ' ' + title + ';'

        return output
